package net.xdclass.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.xdclass.controller.request.ShortLinkAddRequest;
import net.xdclass.controller.request.ShortLinkDelRequest;
import net.xdclass.controller.request.ShortLinkPageRequest;
import net.xdclass.controller.request.ShortLinkUpdateRequest;
import net.xdclass.model.EventMessage;
import net.xdclass.model.ShortLinkDO;
import com.baomidou.mybatisplus.extension.service.IService;
import net.xdclass.util.JsonData;
import net.xdclass.vo.ShortLinkVO;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 王展
 * @since 2024-07-21
 */
public interface ShortLinkService extends IService<ShortLinkDO> {

    /**
     * 解析短链
     * @param shortLinkCode
     * @return
     */
    ShortLinkVO parseShortLinkCode(String shortLinkCode);

    /**
     * 创建短链
     * @param request
     * @return
     */
    JsonData createShortLink(ShortLinkAddRequest request);

    /**
     * 处理新增短链消息
     * @param eventMessage
     * @return
     */
    boolean handlerAddShortLink(EventMessage eventMessage);

    Map pageByGroupId(ShortLinkPageRequest request);

    JsonData del(ShortLinkDelRequest request);

    JsonData update(ShortLinkUpdateRequest request);

    boolean handlerDelShortLink(EventMessage eventMessage);

    boolean handlerUpdateShortLink(EventMessage eventMessage);
}
